Optimal. Leaf size=223 \[ \frac {\tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right ) \left (3 a^2 f h^2-4 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{8 c^{5/2}}-\frac {\sqrt {a+c x^2} \left (4 \left (4 a h^2 (e h+2 f g)+c g \left (f g^2-4 h (3 d h+e g)\right )\right )-h x \left (3 h^2 (4 c d-3 a f)-2 c g (f g-4 e h)\right )\right )}{24 c^2 h}-\frac {\sqrt {a+c x^2} (g+h x)^2 (f g-4 e h)}{12 c h}+\frac {f \sqrt {a+c x^2} (g+h x)^3}{4 c h} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.37, antiderivative size = 222, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {1654, 833, 780, 217, 206} \[ \frac {\tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right ) \left (3 a^2 f h^2-4 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{8 c^{5/2}}-\frac {\sqrt {a+c x^2} \left (4 \left (4 a h^2 (e h+2 f g)-4 c g h (3 d h+e g)+c f g^3\right )-h x \left (3 h^2 (4 c d-3 a f)-2 c g (f g-4 e h)\right )\right )}{24 c^2 h}-\frac {\sqrt {a+c x^2} (g+h x)^2 (f g-4 e h)}{12 c h}+\frac {f \sqrt {a+c x^2} (g+h x)^3}{4 c h} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 217
Rule 780
Rule 833
Rule 1654
Rubi steps
\begin {align*} \int \frac {(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt {a+c x^2}} \, dx &=\frac {f (g+h x)^3 \sqrt {a+c x^2}}{4 c h}+\frac {\int \frac {(g+h x)^2 \left ((4 c d-3 a f) h^2-c h (f g-4 e h) x\right )}{\sqrt {a+c x^2}} \, dx}{4 c h^2}\\ &=-\frac {(f g-4 e h) (g+h x)^2 \sqrt {a+c x^2}}{12 c h}+\frac {f (g+h x)^3 \sqrt {a+c x^2}}{4 c h}+\frac {\int \frac {(g+h x) \left (c h^2 (12 c d g-7 a f g-8 a e h)+c h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right )}{\sqrt {a+c x^2}} \, dx}{12 c^2 h^2}\\ &=-\frac {(f g-4 e h) (g+h x)^2 \sqrt {a+c x^2}}{12 c h}+\frac {f (g+h x)^3 \sqrt {a+c x^2}}{4 c h}-\frac {\left (4 \left (c f g^3-4 c g h (e g+3 d h)+4 a h^2 (2 f g+e h)\right )-h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right ) \sqrt {a+c x^2}}{24 c^2 h}+\frac {\left (8 c^2 d g^2+3 a^2 f h^2-4 a c \left (f g^2+h (2 e g+d h)\right )\right ) \int \frac {1}{\sqrt {a+c x^2}} \, dx}{8 c^2}\\ &=-\frac {(f g-4 e h) (g+h x)^2 \sqrt {a+c x^2}}{12 c h}+\frac {f (g+h x)^3 \sqrt {a+c x^2}}{4 c h}-\frac {\left (4 \left (c f g^3-4 c g h (e g+3 d h)+4 a h^2 (2 f g+e h)\right )-h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right ) \sqrt {a+c x^2}}{24 c^2 h}+\frac {\left (8 c^2 d g^2+3 a^2 f h^2-4 a c \left (f g^2+h (2 e g+d h)\right )\right ) \operatorname {Subst}\left (\int \frac {1}{1-c x^2} \, dx,x,\frac {x}{\sqrt {a+c x^2}}\right )}{8 c^2}\\ &=-\frac {(f g-4 e h) (g+h x)^2 \sqrt {a+c x^2}}{12 c h}+\frac {f (g+h x)^3 \sqrt {a+c x^2}}{4 c h}-\frac {\left (4 \left (c f g^3-4 c g h (e g+3 d h)+4 a h^2 (2 f g+e h)\right )-h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right ) \sqrt {a+c x^2}}{24 c^2 h}+\frac {\left (8 c^2 d g^2+3 a^2 f h^2-4 a c \left (f g^2+h (2 e g+d h)\right )\right ) \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right )}{8 c^{5/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.23, size = 164, normalized size = 0.74 \[ \frac {3 \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a+c x^2}}\right ) \left (3 a^2 f h^2-4 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )+\sqrt {c} \sqrt {a+c x^2} \left (2 c \left (6 d h (4 g+h x)+4 e \left (3 g^2+3 g h x+h^2 x^2\right )+f x \left (6 g^2+8 g h x+3 h^2 x^2\right )\right )-a h (16 e h+32 f g+9 f h x)\right )}{24 c^{5/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.68, size = 381, normalized size = 1.71 \[ \left [-\frac {3 \, {\left (8 \, a c e g h - 4 \, {\left (2 \, c^{2} d - a c f\right )} g^{2} + {\left (4 \, a c d - 3 \, a^{2} f\right )} h^{2}\right )} \sqrt {c} \log \left (-2 \, c x^{2} - 2 \, \sqrt {c x^{2} + a} \sqrt {c} x - a\right ) - 2 \, {\left (6 \, c^{2} f h^{2} x^{3} + 24 \, c^{2} e g^{2} - 16 \, a c e h^{2} + 16 \, {\left (3 \, c^{2} d - 2 \, a c f\right )} g h + 8 \, {\left (2 \, c^{2} f g h + c^{2} e h^{2}\right )} x^{2} + 3 \, {\left (4 \, c^{2} f g^{2} + 8 \, c^{2} e g h + {\left (4 \, c^{2} d - 3 \, a c f\right )} h^{2}\right )} x\right )} \sqrt {c x^{2} + a}}{48 \, c^{3}}, \frac {3 \, {\left (8 \, a c e g h - 4 \, {\left (2 \, c^{2} d - a c f\right )} g^{2} + {\left (4 \, a c d - 3 \, a^{2} f\right )} h^{2}\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {-c} x}{\sqrt {c x^{2} + a}}\right ) + {\left (6 \, c^{2} f h^{2} x^{3} + 24 \, c^{2} e g^{2} - 16 \, a c e h^{2} + 16 \, {\left (3 \, c^{2} d - 2 \, a c f\right )} g h + 8 \, {\left (2 \, c^{2} f g h + c^{2} e h^{2}\right )} x^{2} + 3 \, {\left (4 \, c^{2} f g^{2} + 8 \, c^{2} e g h + {\left (4 \, c^{2} d - 3 \, a c f\right )} h^{2}\right )} x\right )} \sqrt {c x^{2} + a}}{24 \, c^{3}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.23, size = 206, normalized size = 0.92 \[ \frac {1}{24} \, \sqrt {c x^{2} + a} {\left ({\left (2 \, {\left (\frac {3 \, f h^{2} x}{c} + \frac {4 \, {\left (2 \, c^{3} f g h + c^{3} h^{2} e\right )}}{c^{4}}\right )} x + \frac {3 \, {\left (4 \, c^{3} f g^{2} + 4 \, c^{3} d h^{2} - 3 \, a c^{2} f h^{2} + 8 \, c^{3} g h e\right )}}{c^{4}}\right )} x + \frac {8 \, {\left (6 \, c^{3} d g h - 4 \, a c^{2} f g h + 3 \, c^{3} g^{2} e - 2 \, a c^{2} h^{2} e\right )}}{c^{4}}\right )} - \frac {{\left (8 \, c^{2} d g^{2} - 4 \, a c f g^{2} - 4 \, a c d h^{2} + 3 \, a^{2} f h^{2} - 8 \, a c g h e\right )} \log \left ({\left | -\sqrt {c} x + \sqrt {c x^{2} + a} \right |}\right )}{8 \, c^{\frac {5}{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 339, normalized size = 1.52 \[ \frac {\sqrt {c \,x^{2}+a}\, f \,h^{2} x^{3}}{4 c}+\frac {\sqrt {c \,x^{2}+a}\, e \,h^{2} x^{2}}{3 c}+\frac {2 \sqrt {c \,x^{2}+a}\, f g h \,x^{2}}{3 c}+\frac {3 a^{2} f \,h^{2} \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{8 c^{\frac {5}{2}}}-\frac {a d \,h^{2} \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{2 c^{\frac {3}{2}}}-\frac {a e g h \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{c^{\frac {3}{2}}}-\frac {a f \,g^{2} \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{2 c^{\frac {3}{2}}}+\frac {d \,g^{2} \ln \left (\sqrt {c}\, x +\sqrt {c \,x^{2}+a}\right )}{\sqrt {c}}-\frac {3 \sqrt {c \,x^{2}+a}\, a f \,h^{2} x}{8 c^{2}}+\frac {\sqrt {c \,x^{2}+a}\, d \,h^{2} x}{2 c}+\frac {\sqrt {c \,x^{2}+a}\, e g h x}{c}+\frac {\sqrt {c \,x^{2}+a}\, f \,g^{2} x}{2 c}-\frac {2 \sqrt {c \,x^{2}+a}\, a e \,h^{2}}{3 c^{2}}-\frac {4 \sqrt {c \,x^{2}+a}\, a f g h}{3 c^{2}}+\frac {2 \sqrt {c \,x^{2}+a}\, d g h}{c}+\frac {\sqrt {c \,x^{2}+a}\, e \,g^{2}}{c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.45, size = 230, normalized size = 1.03 \[ \frac {\sqrt {c x^{2} + a} f h^{2} x^{3}}{4 \, c} - \frac {3 \, \sqrt {c x^{2} + a} a f h^{2} x}{8 \, c^{2}} + \frac {d g^{2} \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {c}} + \frac {3 \, a^{2} f h^{2} \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{8 \, c^{\frac {5}{2}}} + \frac {\sqrt {c x^{2} + a} e g^{2}}{c} + \frac {2 \, \sqrt {c x^{2} + a} d g h}{c} + \frac {{\left (2 \, f g h + e h^{2}\right )} \sqrt {c x^{2} + a} x^{2}}{3 \, c} + \frac {{\left (f g^{2} + 2 \, e g h + d h^{2}\right )} \sqrt {c x^{2} + a} x}{2 \, c} - \frac {{\left (f g^{2} + 2 \, e g h + d h^{2}\right )} a \operatorname {arsinh}\left (\frac {c x}{\sqrt {a c}}\right )}{2 \, c^{\frac {3}{2}}} - \frac {2 \, {\left (2 \, f g h + e h^{2}\right )} \sqrt {c x^{2} + a} a}{3 \, c^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {{\left (g+h\,x\right )}^2\,\left (f\,x^2+e\,x+d\right )}{\sqrt {c\,x^2+a}} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 15.78, size = 518, normalized size = 2.32 \[ - \frac {3 a^{\frac {3}{2}} f h^{2} x}{8 c^{2} \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {\sqrt {a} d h^{2} x \sqrt {1 + \frac {c x^{2}}{a}}}{2 c} + \frac {\sqrt {a} e g h x \sqrt {1 + \frac {c x^{2}}{a}}}{c} + \frac {\sqrt {a} f g^{2} x \sqrt {1 + \frac {c x^{2}}{a}}}{2 c} - \frac {\sqrt {a} f h^{2} x^{3}}{8 c \sqrt {1 + \frac {c x^{2}}{a}}} + \frac {3 a^{2} f h^{2} \operatorname {asinh}{\left (\frac {\sqrt {c} x}{\sqrt {a}} \right )}}{8 c^{\frac {5}{2}}} - \frac {a d h^{2} \operatorname {asinh}{\left (\frac {\sqrt {c} x}{\sqrt {a}} \right )}}{2 c^{\frac {3}{2}}} - \frac {a e g h \operatorname {asinh}{\left (\frac {\sqrt {c} x}{\sqrt {a}} \right )}}{c^{\frac {3}{2}}} - \frac {a f g^{2} \operatorname {asinh}{\left (\frac {\sqrt {c} x}{\sqrt {a}} \right )}}{2 c^{\frac {3}{2}}} + d g^{2} \left (\begin {cases} \frac {\sqrt {- \frac {a}{c}} \operatorname {asin}{\left (x \sqrt {- \frac {c}{a}} \right )}}{\sqrt {a}} & \text {for}\: a > 0 \wedge c < 0 \\\frac {\sqrt {\frac {a}{c}} \operatorname {asinh}{\left (x \sqrt {\frac {c}{a}} \right )}}{\sqrt {a}} & \text {for}\: a > 0 \wedge c > 0 \\\frac {\sqrt {- \frac {a}{c}} \operatorname {acosh}{\left (x \sqrt {- \frac {c}{a}} \right )}}{\sqrt {- a}} & \text {for}\: c > 0 \wedge a < 0 \end {cases}\right ) + 2 d g h \left (\begin {cases} \frac {x^{2}}{2 \sqrt {a}} & \text {for}\: c = 0 \\\frac {\sqrt {a + c x^{2}}}{c} & \text {otherwise} \end {cases}\right ) + e g^{2} \left (\begin {cases} \frac {x^{2}}{2 \sqrt {a}} & \text {for}\: c = 0 \\\frac {\sqrt {a + c x^{2}}}{c} & \text {otherwise} \end {cases}\right ) + e h^{2} \left (\begin {cases} - \frac {2 a \sqrt {a + c x^{2}}}{3 c^{2}} + \frac {x^{2} \sqrt {a + c x^{2}}}{3 c} & \text {for}\: c \neq 0 \\\frac {x^{4}}{4 \sqrt {a}} & \text {otherwise} \end {cases}\right ) + 2 f g h \left (\begin {cases} - \frac {2 a \sqrt {a + c x^{2}}}{3 c^{2}} + \frac {x^{2} \sqrt {a + c x^{2}}}{3 c} & \text {for}\: c \neq 0 \\\frac {x^{4}}{4 \sqrt {a}} & \text {otherwise} \end {cases}\right ) + \frac {f h^{2} x^{5}}{4 \sqrt {a} \sqrt {1 + \frac {c x^{2}}{a}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________